package com.app.business.web.business.property;

import com.app.business.en.HouseStatus;
import com.app.business.model.*;
import com.app.business.service.*;
import com.app.system.jpa.PageBean;
import com.app.system.log4j2.LogUtils;
import com.app.system.permission.model.DataDict;
import com.app.system.permission.service.DataDictService;
import com.app.system.utils.CollectionUtils;
import com.app.system.utils.ParamUtils;
import com.app.system.utils.WebUtils;
import com.app.system.utils.dataType.BigDecimalUtils;
import com.app.system.utils.dataType.DateUtils;
import com.app.system.utils.dataType.IntegerUtils;
import com.app.system.utils.dataType.StringUtils;
import com.app.system.utils.exception.Precondition;
import com.app.system.utils.exception.Response;
import com.app.system.utils.page.LayUiUtils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import freemarker.template.Configuration;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 物业状态数据管理
 * Created by ddz on 2021/9/8.
 *
 * @author ddz
 */
@Controller
@RequestMapping("/business/property/property/*")
@SuppressWarnings("all")
public class PropertyController {
    @Resource
    private HouseService houseService;
    @Resource
    private DataDictService dataDictService;
    @Resource
    private AzProjectService azProjectService;
    @Resource
    private StorageRoomService storageRoomService;
    @Resource
    private CarLotService carLotService;
    @Resource
    private BuyHousePersonService buyHousePersonService;
    @Resource
    private HouseBuyPersonService houseBuyPersonService;
    @Resource
    private CarLotBuyPersonService carLotBuyPersonService;
    @Resource
    private StatisticsService statisticsService;
    @Autowired
    private StorageRoomPersonService storageRoomPersonService;
    @Resource
    private UserInfoForPropertyService userInfoForPropertyService;
    private Logger logger = LogUtils.getBusinessLogger();

    @Autowired
    private Configuration freemarkerConfiguration; // 注入bean，这里是属性注入，推荐构造注入
    /**
     * 安置房源项目查看列表
     */
    @RequestMapping("azProjectList")
    @RequiresPermissions("property:azProjectList")
    public void azProjectList() {
    }


    /**
     * 加载项目信息数据
     *
     * @return
     */
    @RequestMapping("loadAzProjectList")
    @ResponseBody
    @RequiresPermissions("property:loadAzProjectList")
    public Map loadAzProjectList() {
        List<Map> listData = Lists.newArrayList();
        PageBean<AzProject> azProjectPageBean = this.azProjectService.getPropertyAzProjectPageBean();
        Map<String, String> townMap = dataDictService.getMapByParentNameForValue_Name("乡镇");
        List<AzProject> azProjectList = azProjectPageBean.getDatas();
        if (!CollectionUtils.isEmpty(azProjectList)) {
            Map<String, Map> houseCountMap = this.houseService.getHouseCountMap();
            Map<String, Map> storageRoomCountMap = this.storageRoomService.getStorageRoomCountMap();
            Map<String, Map> carLotCountMap = this.carLotService.getCarLotCountMap();
            Map<String, Object> item = null;
            for (AzProject azProject : azProjectList) {
                item = null;
                item = Maps.newHashMap();
                Map houseMap = CollectionUtils.isEmpty(houseCountMap.get(azProject.getId().toString())) ? Maps.newHashMap() : houseCountMap.get(azProject.getId().toString());
                Map storageRoomMap = CollectionUtils.isEmpty(storageRoomCountMap.get(azProject.getId().toString())) ? Maps.newHashMap() : storageRoomCountMap.get(azProject.getId().toString());
                Map carLotMap = CollectionUtils.isEmpty(carLotCountMap.get(azProject.getId().toString())) ? Maps.newHashMap() : carLotCountMap.get(azProject.getId().toString());
                //全部数量
                String houseTotal = houseMap.get("houseTotal") == null ? "0" : houseMap.get("houseTotal").toString();
                String storageRoomTotal = storageRoomMap.get("storageRoomTotal") == null ? "0" : storageRoomMap.get("storageRoomTotal").toString();
                String carLotTotal = carLotMap.get("carLotTotal") == null ? "0" : carLotMap.get("carLotTotal").toString();
                //已选数量
                String signHouse = houseMap.get("signHouse") == null ? "0" : houseMap.get("signHouse").toString();
                String signStorageRoom = storageRoomMap.get("signStorageRoom") == null ? "0" : storageRoomMap.get("signStorageRoom").toString();
                String signCarLot = carLotMap.get("signCarLot") == null ? "0" : carLotMap.get("signCarLot").toString();
                //已交房数量
                String takeHouseCount = houseMap.get("takeHouseCount") == null ? "0" : houseMap.get("takeHouseCount").toString();
                String takeStorageRoomCount = storageRoomMap.get("takeStorageRoomCount") == null ? "0" : storageRoomMap.get("takeStorageRoomCount").toString();
                String takeCarLotCount = carLotMap.get("takeCarLotCount") == null ? "0" : carLotMap.get("takeCarLotCount").toString();
                item.put("id", azProject.getId());
                item.put("projectCode", azProject.getProjectCode());
                item.put("projectName", azProject.getProjectName());
                item.put("town", StringUtils.getNotNull(townMap.get(azProject.getTown())));
                //全部数量
                item.put("houseCount", houseTotal);
                item.put("storageRoomCount", storageRoomTotal);
                item.put("carLotCount", carLotTotal);
                //已选数量
                item.put("chooseHouseCount", signHouse);
                item.put("chooseStorageRoomCount", signStorageRoom);
                item.put("chooseCarLotCount", signCarLot);
                //已交房数量
                item.put("takeHouseCount", takeHouseCount);
                item.put("takeStorageRoomCount", takeStorageRoomCount);
                item.put("takeCarLotCount", takeCarLotCount);
                listData.add(item);
            }
        }
        return LayUiUtils.page(azProjectPageBean.getTotalCount().intValue(), listData);
    }





    /**
     * 楼盘图界面
     *
     * @param request
     * @param modelMap
     */
    @RequestMapping("housePicture")
    @RequiresPermissions("property:housePicture")
    public void housePicture(HttpServletRequest request, ModelMap modelMap) {
        Integer azProjectId = ParamUtils.getInt(request, "azProjectId", 0);
        AzProject azProject = this.azProjectService.findOne(azProjectId);
        Precondition.checkSqdsArguement(azProject != null, "数据错误！");
        //交房状态
        Map<String, String> colorMap = this.dataDictService.getMapByParentNameForName_Color("房源状态");
        modelMap.addAttribute("colorMap", colorMap);

        List<String> buildNumList = this.userInfoForPropertyService.findByUserIdAndAzProjectId(WebUtils.getLoginUserInfo().getId(), azProject.getId());
        modelMap.addAttribute("azProject", azProject);
        modelMap.addAttribute("buildNumList", buildNumList);
    }

    //房源信息
    @RequestMapping("loadHousePicture")
    @ResponseBody
    @RequiresPermissions("property:loadHousePicture")
    public Map loadHousePicture(HttpServletRequest request) {
        Integer azProjectId = ParamUtils.getInt(request, "azProjectId", 0);
        String buildNum = ParamUtils.getString(request, "buildNum", "");

        //通过安置项目、楼号得到所分配已选房的houseList
        List<House> houseList = houseService.houseList(azProjectId, buildNum);

        //得到层号和当前楼层的List<House>对应的map
        Map<String, List<House>> floorHouseMap = houseService.getFloorHouseMap(houseList);
        Map<String, Integer> maxFloorMap = houseService.getMaxFloorMap(azProjectId, buildNum);
        Integer maxFloor = maxFloorMap.get("maxFloor");
        Map<String, String> colorMap = this.dataDictService.getMapByParentNameForValue_Color("房源状态");
        //房屋类型
        Map<String, String> houseHoldMap = this.dataDictService.getMapByParentNameForValue_Name("房屋户型");
        Map<String, Object> map = Maps.newHashMap();
        map.put("colorMap", colorMap);

        map.put("maxFloor", maxFloor);
        map.put("floorHouseMap", floorHouseMap);
        map.put("houseHoldMap", houseHoldMap);
        return map;
    }

    /**
     * 房屋结构类型详情
     *
     * @param request
     * @return
     */
    @RequestMapping("houseHoldInfo")
    @ResponseBody
    @RequiresPermissions("property:houseHoldInfo")
    public Map houseTypeInfo(HttpServletRequest request) {
        Integer azProjectId = ParamUtils.getInt(request, "azProjectId", 0);
        String buildNum = ParamUtils.getString(request, "buildNum", "");
        Map<String, String> houseHoldMap = this.dataDictService.getMapByParentNameForValue_Name("房屋户型");
        Map<String, Map> houseInfoMap = this.houseService.houseHoldInfoMap(azProjectId, buildNum);
        Map houseHoldTotalMap = this.houseService.houseHoldTotalMap(azProjectId, buildNum);
        Map<String, Object> map = Maps.newHashMap();
        map.put("houseHoldMap", houseHoldMap);
        map.put("houseInfoMap", houseInfoMap);
        map.put("houseHoldTotalMap", houseHoldTotalMap);
        return map;
    }

    /**
     * 物业房源数据管理
     *
     * @param request
     * @param modelMap
     */
    @RequestMapping("wyHouseForm")
    @RequiresPermissions("property:wyHouseForm")
    public void wyHouseForm(HttpServletRequest request, ModelMap modelMap) {
        Integer houseId = ParamUtils.getInt(request, "houseId", 0);
        House house = this.houseService.findOne(houseId);
        Map<String, DataDict> houseHoldMap = this.dataDictService.getMapByParentNameForValue("房屋户型");
        Map<String, DataDict> houseTypeMap = this.dataDictService.getMapByParentNameForValue("房屋类型");
        List<String> ids = this.houseBuyPersonService.getBuyHousePersonIdListByHouseId(house.getId());
        List<BuyHousePerson> buyHousePersonList = new ArrayList<>();
        if (ids.size() != 0) {
            buyHousePersonList = this.buyHousePersonService.getBuyHousePersonListByBuyHousePersonId(ids, house.getContract().getId());
        }
        modelMap.addAttribute("buyHousePersonList", buyHousePersonList);
        modelMap.addAttribute("house", house);
        modelMap.addAttribute("houseHoldMap", houseHoldMap);
        modelMap.addAttribute("houseTypeMap", houseTypeMap);
    }

    /**
     * 房源信息保存
     *
     * @param request
     * @return
     */
    @RequestMapping("wyHouseSave")
    @ResponseBody
    @RequiresPermissions("property:wyHouseSave")
    public Response wyHouseSave(HttpServletRequest request) {
        Integer houseId = ParamUtils.getInt(request, "houseId", 0);
        House house = houseService.findOne(houseId);
        Precondition.checkAjaxArguement(house != null, "1111", "数据错误！");

        WebUtils.bind(request, house);
        houseService.save(house);
        return new Response("0001", "操作成功");
    }






    /**
     * 住宅储物间数据查看列表
     */
    @RequestMapping("wyStorageRoomList")
    @RequiresPermissions("property:wyStorageRoomList")
    public void wyStorageRoomList(HttpServletRequest request, ModelMap modelMap) {
        Integer projectId = ParamUtils.getInt(request, "azProjectId", 0);
        AzProject azProject = this.azProjectService.findOne(projectId);
        Map<String, Map> storageRoomMap = this.statisticsService.getStorageRoomCountMapByAzProjectId();
        modelMap.addAttribute("azProject", azProject);
        modelMap.addAttribute("storageRoomMap", storageRoomMap);
    }

    /**
     * 加载储物间信息数据
     *
     * @return
     */
    @RequestMapping("loadWyStorageRoomList")
    @ResponseBody
    @RequiresPermissions("property:loadWyStorageRoomList")
    public Map loadWyStorageRoomList(HttpServletRequest request) {
        Integer projectId = ParamUtils.getInt(request, "azProjectId", 0);
        List<Map> listData = Lists.newArrayList();
        PageBean<StorageRoom> storageRoomPageBean = this.storageRoomService.storageRoomListByProjectId(projectId);
        List<StorageRoom> storageRoomList = storageRoomPageBean.getDatas();
        Map<String, DataDict> takeHouseMap = this.dataDictService.getMapByParentNameForValue("交房状态");
        Map<String, DataDict> houseStatusMap = this.dataDictService.getMapByParentNameForValue("房源状态");
        if (!CollectionUtils.isEmpty(storageRoomList)) {
            Map<String, Object> item = null;
            for (StorageRoom storageRoom : storageRoomList) {
                item = null;
                item = Maps.newHashMap();
                List<BuyHousePerson> buyHousePersonList = this.buyHousePersonService.getBuyHousePersonListByStorageRoomId(storageRoom.getId());

                item.put("storageRoomId", storageRoom.getId());
                item.put("azProjectName", StringUtils.getNotNull(storageRoom.getAzProject().getProjectName()));
                item.put("houseNum", StringUtils.getNotNull(storageRoom.getHouseNumStr()));
                item.put("buildArea", BigDecimalUtils.getNotNullStr(storageRoom.getBuildArea()));
                item.put("houseStatus", IntegerUtils.getNotNull(storageRoom.getHouseStatus()));
                item.put("houseStatusStr", StringUtils.dataDictShow(houseStatusMap.get(IntegerUtils.getNotNull(storageRoom.getHouseStatus()).toString())));
                item.put("chooseHouseDate", DateUtils.dateToStringDefault(storageRoom.getChooseHouseDate()));

                item.put("takeHouseStatus", IntegerUtils.getNotNull(storageRoom.getTakeHouseStatus()));
                item.put("takeHouseStatusStr", StringUtils.dataDictShow(takeHouseMap.get(IntegerUtils.getNotNull(storageRoom.getTakeHouseStatus()).toString())));
                item.put("takeHouseDate", DateUtils.dateToStringDefault(storageRoom.getTakeHouseDate()));

                String buyHousePersonName = "";
                String buyHousePersonIdCard = "";
                String buyHousePersonTel = "";
                if (!CollectionUtils.isEmpty(buyHousePersonList)) {
                    for (BuyHousePerson buyHousePerson : buyHousePersonList) {
                        if (buyHousePersonList.size() - 1 == buyHousePersonList.indexOf(buyHousePerson)) {

                            buyHousePersonName = buyHousePersonName + buyHousePerson.getName();
                            buyHousePersonIdCard = buyHousePersonIdCard + buyHousePerson.getIdCard();
                            buyHousePersonTel = buyHousePersonTel + buyHousePerson.getTel();
                        } else {
                            buyHousePersonName = buyHousePersonName + buyHousePerson.getName() + "、";
                            buyHousePersonIdCard = buyHousePersonIdCard + buyHousePerson.getIdCard() + "、";
                            buyHousePersonTel = buyHousePersonTel + buyHousePerson.getTel() + "、";
                        }
                    }
                }
                item.put("buyHousePersonName", StringUtils.getNotNull(buyHousePersonName));
                item.put("buyHousePersonIdCard", StringUtils.getNotNull(buyHousePersonIdCard));
                item.put("buyHousePersonTel", StringUtils.getNotNull(buyHousePersonTel));

                listData.add(item);
            }
        }
        return LayUiUtils.page(storageRoomPageBean.getTotalCount().intValue(), listData);
    }

    /**
     * 储物间信息导出
     */
    @RequestMapping("wyStorageRoomListExcel")
    @RequiresPermissions("property:wyStorageRoomListExcel")
    public void wyStorageRoomListExcel(HttpServletRequest request, HttpServletResponse response) {
        Integer projectId = ParamUtils.getInt(request, "azProjectId", 0);
        PageBean<StorageRoom> storageRoomPageBean = this.storageRoomService.storageRoomExcelListByProjectId(projectId);
        List<StorageRoom> storageRoomList = storageRoomPageBean.getDatas();
        Map<String, DataDict> azSignStatusMap = this.dataDictService.getMapByParentNameForValue("签约状态");
        Map<String, DataDict> financeCheckStatusMap = this.dataDictService.getMapByParentNameForValue("复核状态");
        Map<String, DataDict> financeSettleStatusMap = this.dataDictService.getMapByParentNameForValue("财务结清状态");
        Map<String, DataDict> takeHouseStatusMap = this.dataDictService.getMapByParentNameForValue("交房状态");
        Map<String, DataDict> bzStatusMap = this.dataDictService.getMapByParentNameForValue("办证情况");
        Map<String, DataDict> zxStatusMap = this.dataDictService.getMapByParentNameForValue("装修情况");
        Map<String, DataDict> rzStatusMap = this.dataDictService.getMapByParentNameForValue("入住情况");
        Map<String, List<Map>> buyHousePersonMap = this.buyHousePersonService.getBuyHousePersonByStorageRoom();

        try {
            // 封装导出数据
            Map data = Maps.newHashMap();
            data.put("storageRoomList", storageRoomList);
            data.put("azSignStatusMap", azSignStatusMap);
            data.put("financeCheckStatusMap", financeCheckStatusMap);
            data.put("buyHousePersonMap", buyHousePersonMap);
            data.put("financeSettleStatusMap", financeSettleStatusMap);
            data.put("takeHouseStatusMap", takeHouseStatusMap);
            data.put("bzStatusMap", bzStatusMap);
            data.put("zxStatusMap", zxStatusMap);
            data.put("rzStatusMap", rzStatusMap);
            data.put("exportPerson", SecurityUtils.getSubject().getPrincipal());   //导出人姓名
            data.put("exportTime", DateUtils.dateToStringFormat(new Date(), "yyyy-MM-dd HH:mm:ss"));   //导出时间
//            data.put("decisions", exportDecisionList); //第二个worksheet的数据对象
            request.setCharacterEncoding("UTF-8");
            response.setContentType("application/x-download;");
            response.setHeader("Content-disposition", "attachment; filename=" + new String(("储物间明细导出.xls").getBytes(), "iso-8859-1"));
            freemarkerConfiguration.getTemplate("/business/property/property/wyStorageRoomListExcel.ftl").process(data, response.getWriter());
        } catch (Exception e) {
            logger.error("文件下载异常", e);
            e.printStackTrace();
        }
    }

    /**
     * 物业储物间数据管理
     *
     * @param request
     * @param modelMap
     */
    @RequestMapping("wyStorageRoomForm")
    @RequiresPermissions("property:wyStorageRoomForm")
    public void wyStorageRoomForm(HttpServletRequest request, ModelMap modelMap) {
        Integer storageRoomId = ParamUtils.getInt(request, "storageRoomId", 0);
        StorageRoom storageRoom = this.storageRoomService.findOne(storageRoomId);
        List<String> ids = this.storageRoomPersonService.getBuyHousePersonIdListByStorageRoomId(storageRoom.getId());
        List<BuyHousePerson> buyHousePersonList = new ArrayList<>();
        if (ids.size() != 0) {
            buyHousePersonList = this.buyHousePersonService.getBuyHousePersonListByBuyHousePersonId(ids, storageRoom.getContract().getId());
        }
        modelMap.addAttribute("buyHousePersonList", buyHousePersonList);
        modelMap.addAttribute("storageRoom", storageRoom);
    }

    /**
     * 储藏间信息保存
     *
     * @param request
     * @return
     */
    @RequestMapping("wyStorageRoomSave")
    @ResponseBody
    @RequiresPermissions("property:wyStorageRoomSave")
    public Response wyStorageRoomSave(HttpServletRequest request) {
        Integer storageRoomId = ParamUtils.getInt(request, "storageRoomId", 0);
        StorageRoom storageRoom = this.storageRoomService.findOne(storageRoomId);
        Precondition.checkAjaxArguement(storageRoom != null, "0012", "房源不存在");
        WebUtils.bind(request, storageRoom);
        storageRoomService.save(storageRoom);

        Response response = new Response();
        response.setCode("0001");
        return response;
    }




    /**
     * 住宅车位数据查看列表
     */
    @RequestMapping("carLotList")
    @RequiresPermissions("property:carLotList")
    public void carLotList(HttpServletRequest request, ModelMap modelMap) {
        Integer projectId = ParamUtils.getInt(request, "azProjectId", 0);
        AzProject azProject = this.azProjectService.findOne(projectId);
        Map<String, Map> carLotMap = this.statisticsService.getCarLotCountMapByAzProjectId();
        modelMap.addAttribute("azProject", azProject);
        modelMap.addAttribute("carLotMap", carLotMap);
    }

    /**
     * 加载车位信息数据
     *
     * @return
     */
    @RequestMapping("loadCarLotList")
    @ResponseBody
    @RequiresPermissions("property:loadCarLotList")
    public Map loadCarLotList(HttpServletRequest request) {
        Integer projectId = ParamUtils.getInt(request, "azProjectId", 0);
        List<Map> listData = Lists.newArrayList();
        PageBean<CarLot> carLotPageBean = this.carLotService.carLotListByProjectId(projectId);
        List<CarLot> carLotList = carLotPageBean.getDatas();
        Map<String, DataDict> houseStatusMap = this.dataDictService.getMapByParentNameForValue("房源状态");
        Map<String, DataDict> carLotTypeMap = this.dataDictService.getMapByParentNameForValue("车位类型");
        if (!CollectionUtils.isEmpty(carLotList)) {
            Integer houseStatus = null;
            Map<String, Object> item = null;
            for (CarLot carLot : carLotList) {
                houseStatus = null;
                item = null;
                item = Maps.newHashMap();
                item.put("id", carLot.getId());
                item.put("buildNum", StringUtils.getNotNull(carLot.getBuildNum()));
                item.put("houseNum", StringUtils.getNotNull(carLot.getHouseNum()));
                item.put("floor", IntegerUtils.getNotNull(carLot.getFloor()));
                item.put("buildArea", BigDecimalUtils.getNotNullStr(carLot.getBuildArea()));
                item.put("carLotType", StringUtils.dataDictShow(carLotTypeMap.get(carLot.getCarLotType().toString())));
                item.put("houseStatus", carLot.getHouseStatus());
                houseStatus = carLot.getHouseStatus().equals(HouseStatus.YULIU.getIndex()) ? HouseStatus.YIXUAN.getIndex() : carLot.getHouseStatus();
                item.put("houseStatusStr", StringUtils.dataDictShow(houseStatusMap.get(houseStatus.toString())));
                item.put("chooseDate", DateUtils.dateToStringDefault(carLot.getChooseHouseDate()));
                item.put("memo", carLot.getMemo());
                listData.add(item);
            }
        }
        return LayUiUtils.page(carLotPageBean.getTotalCount().intValue(), listData);
    }

    /**
     * 车位信息查看
     *
     * @param request
     * @param modelMap
     */
    @RequestMapping("carLotView")
    @RequiresPermissions("property:carLotView")
    public void carLotView(HttpServletRequest request, ModelMap modelMap) {
        int azProjectId = ParamUtils.getInt(request, "azProjectId", 0);
        int carLotId = ParamUtils.getInt(request, "carLotId", 0);
        AzProject azProject = this.azProjectService.findOne(azProjectId);
        CarLot carLot = this.carLotService.findOne(carLotId);
        Precondition.checkSqdsArguement(azProject != null, "数据错误！");
        Precondition.checkSqdsArguement(carLot != null, "数据错误！");
        Map<String, DataDict> houseTypeMap = this.dataDictService.getMapByParentNameForValue("房屋类型");
        Map<String, DataDict> carLotTypeMap = this.dataDictService.getMapByParentNameForValue("车位类型");

        if (carLot.getContract() != null) {
            Integer contractId = carLot.getContract().getId();
            List<House> houseList = this.houseService.getHouseListByContractId(contractId);
            modelMap.addAttribute("houseList", houseList);
            List<StorageRoom> storageRoomList = this.storageRoomService.getStorageRoomListByContractId(contractId);
            modelMap.addAttribute("storageRoomList", storageRoomList);
            List<CarLot> carLotList = this.carLotService.getCarLotListByContractId(contractId);
            modelMap.addAttribute("carLotList", carLotList);
            List<String> ids = this.carLotBuyPersonService.getBuyHousePersonIdListByCarLotId(carLot.getId());
            List<BuyHousePerson> buyHousePersonList = new ArrayList<>();
            if (ids.size() != 0) {
                buyHousePersonList = this.buyHousePersonService.getBuyHousePersonListByBuyHousePersonId(ids, contractId);
            }
            modelMap.addAttribute("buyHousePersonList", buyHousePersonList);
        }
        modelMap.addAttribute("azProject", azProject);
        modelMap.addAttribute("carLot", carLot);
        modelMap.addAttribute("houseTypeMap", houseTypeMap);
        modelMap.addAttribute("carLotTypeMap", carLotTypeMap);
    }
}
